package oop第二章作业;
import java.util.EnumMap;
import java.util.Enumeration;
import java.util.Scanner;
public class GuessMachine {
    double s=0;
    public  void init(){
        int integer=(int) (Math.random()*10);
        switch (integer){
            case 1:
            case 2:
            case 3:
                System.out.println("小米电视"+"\t\t3399.00");
                s=3399.00;
                break;
            case 4:
            case 5:
            case 6:
                System.out.println("LG电视"+"\t\t5999.00");
                s=  5999.00;
                break;
            case 7:
            case 8:
            case 9:
                System.out.println("海尔电视"+"\t\t12999.00");
                s= 12999.00;
                break;
        }
    }
    public  void guess(){
        Scanner input=new Scanner(System.in);
        int number1 =0;
do {
    number1++;
    System.out.println("请输入一个数");
    double number3=input.nextDouble();
    if (number3==s){
        System.out.println("恭喜您猜对了");
        return;
    }else if (number3>s){
        System.out.println("偏大了，请再小一些");
    }else if (number3<s){
        System.out.println("偏小了，请再大一些");
    }
}while (number1<3);
        System.out.println("下次继续努力");
    }
    public static void main(String[] args) {
        int s=0;
        Scanner input=new Scanner(System.in);
        GuessMachine number=new GuessMachine();
        number.init();
        number.guess();
    }
}
